import http from "./request";
async function getDefaultAdress() {
  let { data } = await http.post(
    `/user/shipping-address/default?token=${localStorage.getItem("token")}`
  );
  return data;
}
//获取默认地址的接口

async function getAdressList() {
  let { data } = await http.post(
    `/user/shipping-address/list?token=${localStorage.getItem("token")}`
  );
  return data;
}
//获取地址列表

async function addAdress(params) {
  let { data } = await http.post(
    `/user/shipping-address/add?provinceId=${params.provinceId}&cityId=${
      params.cityId
    }&address=${params.address}&code=${params.code}&linkMan=${
      params.linkMan
    }&mobile=${params.mobile}&token=${localStorage.getItem("token")}`
  );
  return data;
}
//添加地址

// provinceId,
// cityId,
// address: val.addressDetail,
// code: val.postalCode,
// linkMan: val.name,
// mobile: val.tel,

export { getDefaultAdress, getAdressList, addAdress };
